/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.uc.dao;

import com.xy.biz.uc.domain.bo.TeamUserRelBO;
import com.xy.biz.uc.domain.po.TeamUserRelPO;
import com.xy.biz.uc.domain.query.TeamUserRelQuery;
import com.xy.biz.uc.domain.req.DeleteTeamUserRelRequest;
import com.xy.biz.uc.domain.req.SaveTeamUserRelRequest;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author yzh
 * @date 2021-4-26
 */
public interface TeamUserRelDao {

	/**
	 * 保存
	 *
	 * @param teamUserRelPO
	 */
	int saveTeamUserRel(TeamUserRelPO teamUserRelPO);

	/**
	 * 保存多个
	 *
	 * @param collection
	 */
	int saveAllTeamUserRel(Collection<TeamUserRelPO> collection);

	/**
	 * 更新
	 *
	 * @param teamUserRelPO
	 */
	int updateTeamUserRel(TeamUserRelPO teamUserRelPO);

	/**
	 * 删除
	 *
	 * @param request
	 */
	int deleteTeamUserRel(DeleteTeamUserRelRequest request);

	/**
	 * 条件查找多条
	 *
	 * @param query 查找条件
	 * @return
	 */
	List<TeamUserRelPO> listTeamUserRel(TeamUserRelQuery query);

	/**
	 * 通过用户id列表，团队id查询
	 *
	 * @param query 查找条件
	 * @return
	 */
	List<Long> listTeamUserRelByUserIdList(TeamUserRelQuery query);

	/**
	 * 条件统计个数
	 *
	 * @param query 查找条件
	 * @return
	 */
	int countTeamUserRel(TeamUserRelQuery query);


	/**
	 * 查询团队已存在的用户
	 * @param request
	 * @return
	 */
	List<Long> repeatUserId(SaveTeamUserRelRequest request);

	/**
	 * 邀请加入
	 * @param teamUserRelPOs
	 * @return
	 */
	int inviteJoin(List<TeamUserRelPO> teamUserRelPOs);

	/**
	 * 条件查找多条
	 *
	 * @param teamUserRelPO 查找条件
	 * @return
	 */
	List<TeamUserRelPO> listTeamUser(TeamUserRelPO teamUserRelPO);
}
